/*菜单信息*/
const menuData = [{
    name: '发现音乐',
    children: [
        {
            name: '为你推荐',
        },
        {
            name: '乐库',
        },
        {
            name: '直播',
        },
    ]
},
    {
        name: '我的音乐',
        children: [
            {
                name: '我的收藏',
            },
            {
                name: '默认列表',
            },
            {
                name: '本地与下载',
            },
            {
                name: '音乐云盘',
            },
            {
                name: '已购买音乐',
            },
            {
                name: '最近播放',
            },
        ]
    },
    {
        name: '自建歌单',
        children: [
            {
                name: '我喜欢',
            },
            {
                name: '默认列表',
            },
            {
                name: '动漫歌曲',
            },
            {
                name: '纯音乐',
            },
        ]
    },
    {
        name: '自建歌单',
        children: [
            {
                name: '我喜欢',
            },
            {
                name: '默认列表',
            },
            {
                name: '动漫歌曲',
            },
            {
                name: '纯音乐',
            },
        ]
    },
    {
        name: '自建歌单',
        children: [
            {
                name: '我喜欢',
            },
            {
                name: '默认列表',
            },
            {
                name: '动漫歌曲',
            },
            {
                name: '纯音乐',
            },
        ]
    },
    {
        name: '自建歌单',
        children: [
            {
                name: '我喜欢',
            },
            {
                name: '默认列表',
            },
            {
                name: '动漫歌曲',
            },
            {
                name: '纯音乐',
            },
        ]
    },
    {
        name: '自建歌单',
        children: [
            {
                name: '我喜欢',
            },
            {
                name: '默认列表',
            },
            {
                name: '动漫歌曲',
            },
            {
                name: '纯音乐',
            },
        ]
    },
];
const sidebar = document.querySelector("aside.sidebar ul.node-content")
for (let menuDatum of menuData) {
    const nodeContent = document.createElement('li')
    nodeContent.innerHTML = `<i></i><span>${menuDatum.name}</span> `
    const nodeChildren = document.createElement('ul')
    nodeChildren.classList.add('node-children')
    for (let child of menuDatum.children) {
        const nodeChild = document.createElement('li')
        nodeChild.innerHTML = `${child.name} `
        nodeChildren.appendChild(nodeChild)
    }
    nodeContent.appendChild(nodeChildren)
    sidebar.appendChild(nodeContent)
}

/*音乐信息*/
const mockDataList = [{name: "夜的第七章", artist: "周杰伦、潘儿", album: "依然范特西", duration: "03:48"},
    {name: "Shape of You", artist: "Ed Sheeran", album: "(Deluxe)", duration: "03:53"},
    {
        name: "So Far Away",
        artist: "Martin Garrix、David Guetta、Jamie Scott、Romy Dya",
        album: "So Far Away",
        duration: "03:03"
    },
    {
        name: "I Really Want to Stay at Your House",
        artist: "Cyberpunk",
        album: "Cyberpunk:Edgerunners Soundtrack Vol.1 (Ep1+2)",
        duration: "04:07"
    },
    {
        name: '群青',
        artist: 'YOASOBI',
        album: '群青',
        duration: '04:08',
    },
    {
        name: 'One Last Kiss',
        artist: '宇多田光',
        album: 'One Last Kiss',
        duration: '04:12',
    },
    {
        name: '可爱女人',
        artist: '周杰伦',
        album: 'Jay',
        duration: '03:59',
    },
    {
        name: '人是_',
        artist: '周深',
        album: '人是_',
        duration: '04:35',
    },
    {
        name: '爱如潮水',
        artist: '张信哲',
        album: '心事',
        duration: '04:34',
    },
    {
        name: '像风一样',
        artist: '薛之谦',
        album: '渡 The Crossing',
        duration: '04:15',
    },
    {
        name: '1분 1초',
        artist: '智妍',
        album: 'Never Ever',
        duration: '03:56',
    },
    {
        name: 'Walk Thru Fire',
        artist: 'Vicetone、Meron Ryan',
        album: 'Walk Thru Fire',
        duration: '03:14',
    },
    {
        name: '洋葱',
        artist: '杨宗纬',
        album: '鸽子',
        duration: '04:38',
    },
    {
        name: '小幸运',
        artist: '田馥甄',
        album: '小幸运',
        duration: '04:25',
    },
    {
        name: '人间惊鸿客',
        artist: '叶里',
        album: '人间惊鸿客',
        duration: '03:09',
    },
    {
        name: '芊芊',
        artist: '回音哥',
        album: '回音Echo',
        duration: '03:59',
    },
    {
        name: '千千阙歌',
        artist: '程慧娴',
        album: '永远是你的朋友',
        duration: '04:59',
    },
    {
        name: 'Mojito',
        artist: '周杰伦',
        album: 'Mojito',
        duration: '04:05',
    }
]
const musicTable = document.querySelector("div.table-body")
for (const data of mockDataList) {
    const tableRowElement = document.createElement('div')
    tableRowElement.classList.add('list-row')
    tableRowElement.innerHTML = `
            <div class="cell">${data.name}</div>
            <div class="cell">${data.artist}</div>
            <div class="cell">${data.album}</div>
            <div class="cell">${data.duration}</div>
        `
    musicTable.appendChild(tableRowElement)
}

/*搜索框控制*/
